CREATE TABLE [dbo].[tb_PrestadoresDeServicio]
(
[idPrestadorDeServicio] [int] NOT NULL IDENTITY(1, 1),
[Descripcion] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE TRIGGER [dbo].[updatePrestatario] ON [dbo].[tb_PrestadoresDeServicio] 
FOR UPDATE
AS
if (update(idPrestadorDeServicio)) begin
	UPDATE tb_Servicios
	SET Prestatario = (SELECT idPrestadorDeServicio from inserted)
	WHERE Prestatario in (SELECT idPrestadorDeServicio from deleted)
end
GO
ALTER TABLE [dbo].[tb_PrestadoresDeServicio] ADD CONSTRAINT [PK_tb_PrestadoresDeServicio] PRIMARY KEY NONCLUSTERED  ([idPrestadorDeServicio]) ON [PRIMARY]
GO
